package com.dynamicallo.ty.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dynamicallo.ty.dao.ActionMapper;
import com.dynamicallo.ty.entity.Action;

@Service("actionService")
public class ActionServiceImpl implements IActionService{
    
    
    @Autowired
    private ActionMapper actionMapper;
    public int addAction(Action action) {
        return actionMapper.insert(action);
    }

    public Action getActionById(int actionId) {
        return actionMapper.selectByPrimaryKey(actionId);
    }

    public int updateActionByIdOrOther(Action action) {
        return actionMapper.updateByPrimaryKeySelective(action);
    }

    public List<Action> getAllAction() {
        return actionMapper.getAllAction();
    }

    public List<Action> getAllActionByContentId(Integer contentId) {
        return actionMapper.getAllActionByContentId(contentId);
    }

}
